﻿<%@ Page AutoEventWireup="true" CodeFile="TaskList.aspx.cs" Inherits="Task_TaskList"
    Language="C#" MasterPageFile="Task.master" StylesheetTheme="Content" Title="Untitled Page" %>

<asp:Content ID="Content1" runat="Server" ContentPlaceHolderID="ContentPlaceHolder1">
    <ajaxToolkit:CalendarExtender ID="CalendarExtender_StartDate" runat="server" Format="yyyy-MM-dd"
        TargetControlID="StartDate" Animated="false">
    </ajaxToolkit:CalendarExtender>
    <ajaxToolkit:CalendarExtender ID="CalendarExtender_EndDate" runat="server" Format="yyyy-MM-dd"
        TargetControlID="EndDate" Animated="false">
    </ajaxToolkit:CalendarExtender>
    <ul class="topmenu">
        <li>选择部门：<asp:DropDownList ID="FirstList" runat="server">
        </asp:DropDownList>
        </li>
        <li>选择日期：<asp:TextBox ID="StartDate" runat="server" Width="90px"></asp:TextBox>
            至
            <asp:TextBox ID="EndDate" runat="server" Width="90px"></asp:TextBox></li>
        <li>
            <asp:LinkButton ID="ButtonSearch" runat="server" OnClick="ButtonSearch_Click" Text="查询" /></li>
    </ul>
    <asp:GridView ID="UserGrid" runat="server" DataKeyNames="TaskId" OnRowDataBound="UserGrid_RowDataBound"
        OnRowDeleting="UserGrid_RowDeleting" PageSize="20" Width="100%" Caption="<span>任务列表</span>">
        <Columns>
            <asp:TemplateField HeaderText="序号">
                <ItemStyle HorizontalAlign="Center" />
                <HeaderStyle Width="30px" />
                <ItemTemplate>
                    <asp:Label ID="ID" runat="server" ForeColor="#666666"></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="任务名称">
                <ItemTemplate>
                    [<%# GetTaskTypeName((int)Eval("TaskType")) %>]
                    <asp:HyperLink ID="Title" runat="server" NavigateUrl='<%# Eval("TaskId","ViewTask.aspx?RootId={0}") %>'
                        Text='<%# GetTitle((string)Eval("Title")) %>'>'></asp:HyperLink>
                    [<asp:Label ID="CreateUser" runat="server" Text='<%# Eval("CreateUser") %>'></asp:Label>:
                    <asp:Label ID="CreateDate" runat="server" Text='<%# Eval("CreateDate", "{0:d}") %>'></asp:Label>]
                    <asp:Image ID="Lock" runat="server" ImageAlign="AbsMiddle" ImageUrl="../Images/Lock.gif"
                        ToolTip="任务已锁定" Visible='<%# (bool)Eval("Locked") %>' />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField>
                <ItemStyle HorizontalAlign="Right" />
                <ItemTemplate>
                    <asp:HyperLink ID="ButtonEdit" runat="server" NavigateUrl='<%# Eval("TaskId","EditView.aspx?RootId={0}") %>'
                        Visible='<%# !(bool)Eval("Locked") %>'>编辑</asp:HyperLink>
                    <asp:HyperLink ID="ButtonSplit" runat="server" NavigateUrl='<%# Eval("TaskId","SplitTask.aspx?RootId={0}") %>'
                        Visible='<%# !(bool)Eval("Locked") %>'>分解</asp:HyperLink>
                    <asp:LinkButton ID="ButtonDelete" runat="server" CommandName="Delete" Visible='<%# !(bool)Eval("Locked") %>'>删除</asp:LinkButton>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
    <div style="padding: 4px;">
        <div style="float: left">
            <asp:Label ID="lbGridInfo" runat="server"></asp:Label>
        </div>
        <div style="float: right">
            <asp:LinkButton ID="btnFirst" runat="server" CommandArgument="First" CommandName="Page"
                OnClick="btnFirst_Click">首页</asp:LinkButton>
            <asp:LinkButton ID="btnPrev" runat="server" CommandArgument="Prev" CommandName="Page"
                OnClick="btnPrev_Click">上一页</asp:LinkButton>
            <asp:LinkButton ID="btnNext" runat="server" CommandArgument="Next" CommandName="Page"
                OnClick="btnNext_Click">下一页</asp:LinkButton>
            <asp:LinkButton ID="btnLast" runat="server" CommandArgument="Last" CommandName="Page"
                OnClick="btnLast_Click">末页</asp:LinkButton>
            转到：第
            <asp:DropDownList ID="JumpList" runat="server" AutoPostBack="True" OnSelectedIndexChanged="JumpList_SelectedIndexChanged">
            </asp:DropDownList>
            页
        </div>
    </div>
</asp:Content>
